package com.goodving.guli.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.goodving.guli.utility.C1215d;
import com.goodving.guli.utility.Constants;
import com.goodving.guli.utility.LdlDate;

import java.text.DecimalFormat;
import java.util.Random;

/**
 * Created by Administrator on 2015-11-16.
 */
public class DailyStats implements Parcelable {
    public static final Creator<DailyStats> CREATOR;
    private double totalCal;
    private int stepCnt;
    private int activeValue;
    private double pm25;
    private double walkCal;
    private double walkDistance;
    private double walkDuration;
    private int walkStep;
    private int runStep;
    private double runCal;
    private double runDistance;
    private double runDuration;
    private double cyclingCal;
    private double cyclingDistance;
    private double cyclingDuration;
    private double totalDistance;
    private double totalDuration;
//    private int f4835r;
    private int goalStep;


    private LdlDate f4837t;

    public int getWalkStep() {
        return this.walkStep;
    }

    public void setWalkStep(int i) {
        this.walkStep = i;
    }

    public int getRunStep() {
        return this.runStep;
    }

    public void setRunStep(int i) {
        this.runStep = i;
    }

    public double getTotalDistance() {
        return this.totalDistance;
    }

    public void setTotalDistance(double d) {
        this.totalDistance = d;
    }

    public double getTotalDuration() {
        return this.totalDuration;
    }

    public void setTotalDuration(double d) {
        this.totalDuration = d;
    }

    public double getTotalCal() {
        return this.totalCal;
    }

    public void setTotalCal(double d) {
        this.totalCal = d;
    }

    public int getStepCnt() {
        return this.stepCnt;
    }

    public void setStepCnt(int i) {
        this.stepCnt = i;
    }

    public boolean m8661g() {
        if (this.stepCnt < 0 || this.stepCnt > 200000) {
            return false;
        }
        return true;
    }

    public int getActiveValue() {
        return this.activeValue;
    }

    public void setActiveValue(int i) {
        this.activeValue = i;
    }

    public double getPm25() {
        return this.pm25;
    }

    public void setPm25(double d) {
        this.pm25 = d;
    }

    public double getWalkCal() {
        return this.walkCal;
    }

    public void setWalkCal(double d) {
        this.walkCal = d;
    }

    public double getWalkDistance() {
        return this.walkDistance;
    }

    public void setWalkDistance(double d) {
        this.walkDistance = d;
    }

    public double getWalkDuration() {
        return this.walkDuration;
    }

    public void setWalkDuration(double d) {
        this.walkDuration = d;
    }

    public double getRunCal() {
        return this.runCal;
    }

    public void setRunCal(double d) {
        this.runCal = d;
    }

    public double getRunDistance() {
        return this.runDistance;
    }

    public void setRunDistance(double d) {
        this.runDistance = d;
    }

    public double getRunDuration() {
        return this.runDuration;
    }

    public void setRunDuration(double d) {
        this.runDuration = d;
    }

    public double getCyclingCal() {
        return this.cyclingCal;
    }

    public void setCyclingCal(double d) {
        this.cyclingCal = d;
    }

    public double getCyclingDistance() {
        return this.cyclingDistance;
    }

    public void setCyclingDistance(double d) {
        this.cyclingDistance = d;
    }

    public double getCyclingDuration() {
        return this.cyclingDuration;
    }

    public void setCyclingDuration(double d) {
        this.cyclingDuration = d;
    }

//    public int m8680s() {
//        return this.f4835r;
//    }
//
//    public void m8655e(int i) {
//        this.f4835r = i;
//    }
//
    public int getGoalStep() {
        return this.goalStep;
    }

    public void setGoalStep(int i) {
        this.goalStep = i;
    }

    public LdlDate m8682u() {
        return this.f4837t;
    }

    public void setBitmap(LdlDate c1211c) {
        this.f4837t = c1211c;
    }

    public DailyStats updateDailyStats(byte[] bArr) {
//        try {
//            C1241h a = C1241h.m10074a(bArr);
//            this.totalCal = a.m10130f();
//            this.stepCnt = a.m10132h();
//            this.activeValue = a.m10134j();
//            this.pm25 = a.m10139o();
//            this.walkCal = a.m10106G();
//            this.walkDistance = a.m10149y();
//            this.walkDuration = a.m10116Q();
//            this.runCal = a.m10102C();
//            this.runDistance = a.m10141q();
//            this.runDuration = a.m10143s();
//            this.cyclingCal = a.m10104E();
//            this.cyclingDistance = a.m10145u();
//            this.cyclingDuration = a.m10147w();
//            this.totalDistance = a.m10114O();
//            this.totalDuration = a.m10116Q();
//            this.f4835r = a.m10108I();
//            this.goalStep = a.m10110K();
//            this.runStep = a.m10118S();
//            this.walkStep = a.m10120U();
//            this.f4837t = LdlDate.m8857a(a.m10128d());
//        } catch (C2171x e) {
//            e.printStackTrace();
//        }
        return this;
    }

//    public static long m8638a(long j) {
//        return (((((((((255 & j) >> null) << 56) | (((65280 & j) >> 8) << 48)) | (((16711680 & j) >> 16) << 40)) | (((4278190080L & j) >> 24) << 32)) | (((1095216660480L & j) >> 32) << 24)) | (((280375465082880L & j) >> 40) << 16)) | (((71776119061217280L & j) >> 48) << 8)) | (((-72057594037927936L & j) >> 56) << null);
//    }
//
//    public long m8683v() {
//        return m8638a(Double.doubleToLongBits(this.f4837t.m8883p()));
//    }

//    public double m8675n(double d) {
//        return (0.42d * d) * ((double) this.stepCnt);
//    }

//    public String m8659g(int i) {
//        DecimalFormat decimalFormat = new DecimalFormat();
//        double d;
//        String str;
//        switch (i) {
//            case 0 /*0*/:
//                d = (this.totalDistance - this.runDistance) / 1000.0d;
//                decimalFormat.applyPattern("0.0");
//                if (this.runDistance > 100.0d) {
//                    return " \u6b65\u884c " + decimalFormat.format(d) + " \u516c\u91cc\uff0c" + "\u8dd1\u6b65 " + decimalFormat.format(this.runDistance / 1000.0d) + " \u516c\u91cc";
//                }
//                return " \u76f8\u5f53\u4e8e\u6b65\u884c" + decimalFormat.format(d) + " \u516c\u91cc";
//            case 1 /*1*/:
//                d = this.totalDistance / 3500.0d;
//                str = Constants.VIA_RESULT_SUCCESS;
//                if (d < Constants.DEFAULT_INTENSITY) {
//                    str = "0.0";
//                }
//                decimalFormat.applyPattern(str);
//                return " ≈ \u7ed5\u6545\u5bab " + decimalFormat.format(d) + " \u5708";
//            case 2 /*2*/:
//                d = this.totalDistance / 1700.0d;
//                str = Constants.VIA_RESULT_SUCCESS;
//                if (d < Constants.DEFAULT_INTENSITY) {
//                    str = "0.0";
//                }
//                decimalFormat.applyPattern(str);
//                return " ≈ " + decimalFormat.format(d) + " \u5ea7\u6b66\u6c49\u957f\u6c5f\u5927\u6865\u7684\u957f\u5ea6";
//            case ed.f15050d /*3*/:
//                d = this.totalDistance / 450.0d;
//                str = Constants.VIA_RESULT_SUCCESS;
//                if (d < Constants.DEFAULT_INTENSITY) {
//                    str = "0.0";
//                }
//                decimalFormat.applyPattern(str);
//                return " ≈ " + decimalFormat.format(d) + "  \u4e2a\u5e1d\u56fd\u5927\u53a6\u645e\u8d77\u6765\u7684\u9ad8\u5ea6";
//            default:
//                d = this.totalDistance / 25.0d;
//                str = Constants.VIA_RESULT_SUCCESS;
//                if (d < Constants.DEFAULT_INTENSITY) {
//                    str = "0.0";
//                }
//                decimalFormat.applyPattern(str);
//                return " ≈ " + decimalFormat.format(d) + "  \u8282\u706b\u8f66\u8f66\u53a2\u8fde\u8d77\u6765\u7684\u957f\u5ea6";
//        }
//    }

    public String m8684w() {
        int nextInt = new Random().nextInt() % 1;
        DecimalFormat decimalFormat = new DecimalFormat();
        double d;
        String str;
        switch (nextInt) {
            case 0 /*0*/:
                d = (this.totalDistance - this.runDistance) / 1000.0d;
                decimalFormat.applyPattern("0.0");
                if (this.runDistance > 100.0d) {
                    return " 步行 " + decimalFormat.format(d) + " 公里，" + "跑步 " + decimalFormat.format(this.runDistance / 1000.0d) + " 公里";
                }
                return " 相当于步行" + decimalFormat.format(d) + " 公里";
            case 1 /*1*/:
                d = this.totalDistance / 3500.0d;
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ \u7ed5\u6545\u5bab " + decimalFormat.format(d) + " \u5708";
            case 2 /*2*/:
                d = this.totalDistance / 1700.0d;
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + " \u5ea7\u6b66\u6c49\u957f\u6c5f\u5927\u6865\u7684\u957f\u5ea6";
            case 3 /*3*/:
                d = this.totalDistance / 450.0d;
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + "  \u4e2a\u5e1d\u56fd\u5927\u53a6\u645e\u8d77\u6765\u7684\u9ad8\u5ea6";
            default:
                d = this.totalDistance / 25.0d;
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + "  \u8282\u706b\u8f66\u8f66\u53a2\u8fde\u8d77\u6765\u7684\u957f\u5ea6";
        }
    }

    public String m8685x() {
        DecimalFormat decimalFormat = new DecimalFormat();
        decimalFormat.applyPattern("0.0");
        return decimalFormat.format(this.totalDistance / 1000.0d);
    }

    public String m8686y() {
        double d;
        DecimalFormat decimalFormat;
        String str;
        switch (new Random().nextInt() % 5) {
            case 0 /*0*/:
                d = this.totalCal / 116.0d;
                decimalFormat = new DecimalFormat();
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " 消耗了 " + decimalFormat.format(d) + " 碗米饭的热量";
            case 1 /*1*/:
                d = this.totalCal / 105.0d;
                decimalFormat = new DecimalFormat();
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + " 个甜筒冰淇淋";
            case 2 /*2*/:
                d = this.totalCal / 450.0d;
                decimalFormat = new DecimalFormat();
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + " \u65a4\u9ebb\u8fa3\u5c0f\u9f99\u867e";
            case 3 /*3*/:
                d = this.totalCal / 69.0d;
                decimalFormat = new DecimalFormat();
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + " 支羊肉串";
            default:
                d = this.totalCal / 44.0d;
                decimalFormat = new DecimalFormat();
                str = Constants.VIA_RESULT_SUCCESS;
                if (d < Constants.DEFAULT_INTENSITY) {
                    str = "0.0";
                }
                decimalFormat.applyPattern(str);
                return " ≈ " + decimalFormat.format(d) + " 杯啤酒";
        }
    }

    public String m8687z() {
        switch (new Random().nextInt() % 5) {
            case 0 /*0*/:
                return " 每天活跃时间最好在60分钟以上";
            case 1 /*1*/:
                return " 运动就能让活跃时间增长哦";
            case 2 /*2*/:
                return " 伏案工作时，最好每小时都能起来运动几分钟";
            default:
                return " 别坐太久，起来拉伸一下吧!";
        }
    }

    public DailyStats(){


    }
    public DailyStats(Parcel parcel) {
        this.totalCal = parcel.readDouble();
        this.stepCnt = parcel.readInt();
        this.activeValue = parcel.readInt();
        this.pm25 = parcel.readDouble();
        this.walkCal = parcel.readDouble();
        this.walkDistance = parcel.readDouble();
        this.walkDuration = parcel.readDouble();
        this.runCal = parcel.readDouble();
        this.runDistance = parcel.readDouble();
        this.runDuration = parcel.readDouble();
        this.cyclingCal = parcel.readDouble();
        this.cyclingDistance = parcel.readDouble();
        this.cyclingDuration = parcel.readDouble();
        this.totalDistance = parcel.readDouble();
        this.totalDuration = parcel.readDouble();
//        this.f4835r = parcel.readInt();
//        this.goalStep = parcel.readInt();
        this.runStep = parcel.readInt();
        this.walkStep = parcel.readInt();
//        this.f4837t = LdlDate.m8859a(parcel.readLong());
    }

    static {
        CREATOR = new C1215d();
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeDouble(this.totalCal);
        parcel.writeInt(this.stepCnt);
        parcel.writeInt(this.activeValue);
        parcel.writeDouble(this.pm25);
        parcel.writeDouble(this.walkCal);
        parcel.writeDouble(this.walkDistance);
        parcel.writeDouble(this.walkDuration);
        parcel.writeDouble(this.runCal);
        parcel.writeDouble(this.runDistance);
        parcel.writeDouble(this.runDuration);
        parcel.writeDouble(this.cyclingCal);
        parcel.writeDouble(this.cyclingDistance);
        parcel.writeDouble(this.cyclingDuration);
        parcel.writeDouble(this.totalDistance);
        parcel.writeDouble(this.totalDuration);
//        parcel.writeInt(this.f4835r);
//        parcel.writeInt(this.goalStep);
        parcel.writeInt(this.runStep);
        parcel.writeInt(this.walkStep);
//        parcel.writeLong(this.f4837t.getTime());
    }
}

